{include file="public/header" /}
<body>
<div class="container" id="container">
    <div class="page input js_show">
        <div class="page__hd">
            <h3 class="page__title">支付</h3>
        </div>
        <div class="page__bd">

                <div class="weui-cells ">
                    <div class="weui-cell ">
                        <div class="weui-cell__bd">

                            <label class="weui-label">金额</label>
                        </div>
                        <div class="weui-cell__ft"> {$data.money}</div>
                    </div>
                    <div class="weui-cell ">
                        <div class="weui-cell__hd">
                            <label class="weui-label">计划时间</label>
                        </div>
                        <div class="weui-cell__ft"> {$data.plan.billDate}-{$data.plan.repayDate}</div>
                    </div>
                </div>

            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_primary"  onclick="callpay()" >支付</a>
            </div>
        </div>

    </div>

</div>
{include file="public/footer" /}
<script>

    //调用微信JS api 支付
    function jsApiCall()
    {
        WeixinJSBridge.invoke
        (
            'getBrandWCPayRequest',
                {$jsApiParameters},
            function(res){
                if(res.err_code){
                    //WeixinJSBridge.log(res.err_msg);
                    //alert(res.err_code+res.err_desc+res.err_msg);
                }

            }
        );
    }

    function callpay()
    {
        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
            }
        }else{
            jsApiCall();
        }
    }
</script>
</body>
</html>
